package cn.gson.springboot.model.pojos;

import javax.persistence.*;
import java.math.BigDecimal;
import java.sql.Date;
import java.util.Objects;

@Entity
@Table(name = "payment_invoice", schema = "crm")
public class PaymentInvoice {
    private int paymentInvoiceId;
    private String paymentInvoiceAbstract;
    private Integer paymentInvoicePaperType;
    private BigDecimal paymentInvoiceAmount;
    private Date paymentInvoiceTicketDate;
    private Integer paymentInvoicePeriods;
    private Integer paymentInvoiceWhetherPay;
    private Integer paymentInvoiceWhetherPayPlan;
    private String paymentInvoiceNo;
    private String paymentInvoiceNote;
    private Customer customerByCustomerId;// 供应商
    private Employee employeeByEmpId;
    private Purchase purchaseByPurchaseId;

    @Id
    @Column(name = "payment_invoice_id", nullable = false)
    public int getPaymentInvoiceId() {
        return paymentInvoiceId;
    }

    public void setPaymentInvoiceId(int paymentInvoiceId) {
        this.paymentInvoiceId = paymentInvoiceId;
    }

    @Basic
    @Column(name = "payment_invoice_abstract", nullable = true, length = 255)
    public String getPaymentInvoiceAbstract() {
        return paymentInvoiceAbstract;
    }

    public void setPaymentInvoiceAbstract(String paymentInvoiceAbstract) {
        this.paymentInvoiceAbstract = paymentInvoiceAbstract;
    }

    @Basic
    @Column(name = "payment_invoice_paper_type", nullable = true)
    public Integer getPaymentInvoicePaperType() {
        return paymentInvoicePaperType;
    }

    public void setPaymentInvoicePaperType(Integer paymentInvoicePaperType) {
        this.paymentInvoicePaperType = paymentInvoicePaperType;
    }

    @Basic
    @Column(name = "payment_invoice_amount", nullable = true)
    public BigDecimal getPaymentInvoiceAmount() {
        return paymentInvoiceAmount;
    }

    public void setPaymentInvoiceAmount(BigDecimal paymentInvoiceAmount) {
        this.paymentInvoiceAmount = paymentInvoiceAmount;
    }

    @Basic
    @Column(name = "payment_invoice_ticket_date", nullable = true)
    public Date getPaymentInvoiceTicketDate() {
        return paymentInvoiceTicketDate;
    }

    public void setPaymentInvoiceTicketDate(Date paymentInvoiceTicketDate) {
        this.paymentInvoiceTicketDate = paymentInvoiceTicketDate;
    }

    @Basic
    @Column(name = "payment_invoice_periods", nullable = true)
    public Integer getPaymentInvoicePeriods() {
        return paymentInvoicePeriods;
    }

    public void setPaymentInvoicePeriods(Integer paymentInvoicePeriods) {
        this.paymentInvoicePeriods = paymentInvoicePeriods;
    }

    @Basic
    @Column(name = "payment_invoice_whether_pay", nullable = true)
    public Integer getPaymentInvoiceWhetherPay() {
        return paymentInvoiceWhetherPay;
    }

    public void setPaymentInvoiceWhetherPay(Integer paymentInvoiceWhetherPay) {
        this.paymentInvoiceWhetherPay = paymentInvoiceWhetherPay;
    }

    @Basic
    @Column(name = "payment_invoice_whether_pay_plan", nullable = true)
    public Integer getPaymentInvoiceWhetherPayPlan() {
        return paymentInvoiceWhetherPayPlan;
    }

    public void setPaymentInvoiceWhetherPayPlan(Integer paymentInvoiceWhetherPayPlan) {
        this.paymentInvoiceWhetherPayPlan = paymentInvoiceWhetherPayPlan;
    }

    @Basic
    @Column(name = "payment_invoice_no", nullable = true, length = 255)
    public String getPaymentInvoiceNo() {
        return paymentInvoiceNo;
    }

    public void setPaymentInvoiceNo(String paymentInvoiceNo) {
        this.paymentInvoiceNo = paymentInvoiceNo;
    }

    @Basic
    @Column(name = "payment_invoice_note", nullable = true, length = 255)
    public String getPaymentInvoiceNote() {
        return paymentInvoiceNote;
    }

    public void setPaymentInvoiceNote(String paymentInvoiceNote) {
        this.paymentInvoiceNote = paymentInvoiceNote;
    }


    @ManyToOne
    @JoinColumn(name = "purchase_id", referencedColumnName = "purchase_id")
    public Purchase getPurchaseByPurchaseId() {
        return purchaseByPurchaseId;
    }

    public void setPurchaseByPurchaseId(Purchase purchaseByPurchaseId) {
        this.purchaseByPurchaseId = purchaseByPurchaseId;
    }

    @ManyToOne
    @JoinColumn(name = "customer_id", referencedColumnName = "customer_id")
    public Customer getCustomerByCustomerId() {
        return customerByCustomerId;
    }

    public void setCustomerByCustomerId(Customer customerByCustomerId) {
        this.customerByCustomerId = customerByCustomerId;
    }

    @ManyToOne
    @JoinColumn(name = "emp_id", referencedColumnName = "emp_id")
    public Employee getEmployeeByEmpId() {
        return employeeByEmpId;
    }

    public void setEmployeeByEmpId(Employee employeeByEmpId) {
        this.employeeByEmpId = employeeByEmpId;
    }

}
